package com.yidu.DailyFinalTreatment.mapper;


import com.yidu.DailyFinalTreatment.entity.BondSecurity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
@Mapper
public interface BondSecurityMapper {
    @Select("SELECT b.bondName,b.bondId,b.bondRate,s.securityNum,b.bondType,b.bondMoney,s.securityInventorsTime" +
            ",b.bondstartDate,s.fundId,s.securityId,ROUND((b.bondRate/365*b.bondMoney*s.securityNum),2)AS interest FROM " +
            "(SELECT * FROM Bond)b JOIN (SELECT * FROM securityInventors where ${date})s ON b.bondId=s.securityId ")
    public List<BondSecurity> selectBondSecurity(Map map);
}
